home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Applications / Graphics / Draw / ArtBeat / ArtBeat Professional 1.0 Demo / ArtBeat Professional 1.0 Demo.rsrc / ABPS_200_AB_Dict < prev    next >
Encoding:
Text File  |  1992-12-08  |  9.2 KB  |  664 lines

  1. /ABdict 250 dict def
  2. ABdict begin
  3. /bdf 
  4.     {
  5.     bind def
  6.     }def
  7. /ldf 
  8.     {
  9.     load def
  10.     } bdf
  11. /edf 
  12.     {
  13.     exch def
  14.     } def
  15. /sput 
  16.     {
  17.     exch def
  18.     } def
  19. /inch 
  20.     {
  21.     72 mul 
  22.     } bdf
  23. %%GENERAL
  24. /i systemdict/image get def
  25. /iOR systemdict/imagemask get def
  26. /ncolors 0 def
  27. /st0 () def
  28. /st1 () def
  29. /proc0 
  30.     {
  31.     }def
  32. /dot 
  33.     {
  34.     dup mul    exch dup mul add 1.0 exch sub
  35.     } bdf
  36. /tan 
  37.     {
  38.     dup sin exch cos div
  39.     } bdf
  40. /setcmykcolor where not
  41.     {
  42.     /setcmykcolor
  43.         {
  44.         /b edf 3
  45.             {
  46.             b add 1.0 exch sub 0.0 max 1.0 min 3 1 roll
  47.             }repeat systemdict begin setrgbcolor end
  48.         }bdf
  49.     }
  50.     {
  51.     pop
  52.     }ifelse
  53. /rotateMAT        
  54.     {
  55.     /theta sput
  56.     /ax theta cos def    /cy theta sin neg def    
  57.     /bx theta sin def    /dy theta cos def
  58.     [ax bx cy dy 0 0]
  59.     }bdf
  60. /scaleMAT
  61.     {
  62.     /cy sput /ax sput
  63.     [ax 0 0 cy 0 0]
  64.     }bdf
  65. /skewHMAT
  66.     {
  67.     /theta sput
  68.     /ax 1 def    /cy theta tan def
  69.     /bx 0 def    /dy 1 def
  70.     [ax bx cy dy 0 0]
  71.     }bdf
  72. /skewVMAT
  73.     {
  74.     /theta exch def
  75.     /ax 1 def             /cy 0 def    
  76.     /bx theta tan def    /dy 1 def
  77.     [ax bx cy dy 0 0]
  78.     }bdf
  79. /drawline
  80.     {
  81.     %% stack: bx cy ax dy
  82.     /dy sput /ax sput
  83.     /cy sput /bx sput
  84.     gsave
  85.     newpath
  86.     bx cy moveto
  87.     ax dy lineto    
  88.     pnh pnv eq
  89.         {
  90.         pnh setlinewidth stroke
  91.         }
  92.         {
  93.         gsave 1 setlinewidth pnh pnv scale stroke grestore
  94.         }ifelse
  95.     grestore
  96.     }bdf
  97. /framerect
  98.     {
  99.     /cy sput /ax sput
  100.     /dy sput /bx sput
  101.     gsave
  102.     newpath
  103.     bx dy moveto
  104.     ax dy lineto        
  105.     ax cy lineto        
  106.     bx cy lineto        
  107.     closepath
  108.     pnh pnv eq
  109.         {
  110.         pnh setlinewidth stroke
  111.         }
  112.         {
  113.         gsave 1 setlinewidth pnh pnv scale stroke grestore
  114.         }ifelse
  115.     grestore
  116.     }bdf
  117. /paintrect
  118.     {
  119.     /dy sput /ax sput
  120.     /cy sput /bx sput
  121.     gsave
  122.     newpath
  123.     bx cy moveto
  124.     ax cy lineto        
  125.     ax dy lineto        
  126.     bx dy lineto        
  127.     closepath
  128.     fill
  129.     grestore
  130.     }bdf
  131. /framerrect
  132.     {
  133.     /r sput
  134.     /cy sput
  135.     /ax sput
  136.     /y sput
  137.     /x sput
  138.     /ax2 ax 2 div def
  139.     /cy2 cy 2 div def
  140.     gsave
  141.     newpath
  142.     x y translate
  143.     0 cy2 moveto
  144.     % draw 1/4 rrect from ax/2,cy/2,ax/2,0,r        
  145.     ax2 cy2 ax2 0 r arcto
  146.     4
  147.         {
  148.         pop
  149.         } repeat  
  150.     ax2 0 lineto
  151.     % draw 1/4 rrect from ax/2,-cy/2,0,-cy/2,r        
  152.     ax2 cy2 neg 0 cy2 neg r arcto
  153.     4
  154.         {
  155.         pop
  156.         } repeat  
  157.     0 cy2 neg lineto
  158.     % draw 1/4 rrect from -ax/2,-cy/2,-ax/2,0,r        
  159.     ax2 neg cy2 neg ax2 neg 0 r arcto
  160.     4
  161.         {
  162.         pop
  163.         } repeat  
  164.     ax2 neg 0 lineto
  165.     % draw 1/4 rrect from -ax/2,cy/2,0,cy/2,r        
  166.     ax2 neg cy2 0 cy2 r arcto
  167.     4
  168.         {
  169.         pop
  170.         } repeat  
  171.     closepath
  172.     pnh pnv eq
  173.         {
  174.         pnh setlinewidth stroke
  175.         }
  176.         {
  177.         gsave 1 setlinewidth pnh pnv scale stroke grestore
  178.         }ifelse
  179.     grestore
  180.     } bdf
  181. /paintrrect
  182.     {
  183.     /r sput
  184.     /cy sput
  185.     /ax sput
  186.     /y sput
  187.     /x sput
  188.     /ax2 ax 2 div def
  189.     /cy2 cy 2 div def
  190.     gsave
  191.     newpath
  192.     x y translate
  193.     0 cy2 moveto
  194.     % draw 1/4 rrect from ax/2,cy/2,ax/2,0,r        
  195.     ax2 cy2 ax2 0 r arcto
  196.     4
  197.         {
  198.         pop
  199.         } repeat  
  200.     ax2 0 lineto
  201.     % draw 1/4 rrect from ax/2,-cy/2,0,-cy/2,r        
  202.     ax2 cy2 neg 0 cy2 neg r arcto
  203.     4
  204.         {
  205.         pop
  206.         } repeat  
  207.     0 cy2 neg lineto
  208.     % draw 1/4 rrect from -ax/2,-cy/2,-ax/2,0,r        
  209.     ax2 neg cy2 neg ax2 neg 0 r arcto
  210.     4
  211.         {
  212.         pop
  213.         } repeat  
  214.     ax2 neg 0 lineto
  215.     % draw 1/4 rrect from -ax/2,cy/2,0,cy/2,r        
  216.     ax2 neg cy2 0 cy2 r arcto
  217.     4
  218.         {
  219.         pop
  220.         } repeat  
  221.     closepath
  222.     fill
  223.     grestore
  224.     } bdf
  225. /framearc
  226.     {
  227.     /bx sput
  228.     /ax sput
  229.     /cy sput
  230.     /dy sput
  231.     /y sput
  232.     /x sput
  233.     /savemat matrix currentmatrix def
  234.     newpath
  235.     x y translate
  236.     dy cy scale
  237.     0 0 1 ax bx arc
  238.     savemat setmatrix
  239.     pnh pnv eq
  240.         {
  241.         pnh setlinewidth stroke
  242.         }
  243.         {
  244.         gsave 1 setlinewidth pnh pnv scale stroke grestore
  245.         }ifelse
  246.     }bdf
  247. /paintarc
  248.     {
  249.     /bx sput
  250.     /ax sput
  251.     /cy sput
  252.     /dy sput
  253.     /y sput
  254.     /x sput
  255.     /savemat matrix currentmatrix def
  256.     newpath
  257.     x y translate
  258.     0 0 moveto
  259.     dy cy scale
  260.     0 0 1 ax bx arc
  261.     closepoly
  262.     savemat setmatrix
  263.     fill
  264.     }bdf
  265. /frameoval
  266.     {
  267.     /cy sput
  268.     /dy sput
  269.     /y sput
  270.     /x sput
  271.     /savemat matrix currentmatrix def
  272.     gsave
  273.     newpath
  274.     x y translate
  275.     dy cy scale
  276.     0 0 1 0 360 arc
  277.     savemat setmatrix
  278.     pnh pnv eq
  279.         {
  280.         pnh setlinewidth stroke 
  281.         }
  282.         {
  283.         gsave 1 setlinewidth pnh pnv scale stroke grestore
  284.         }ifelse
  285.     grestore
  286.     }bdf
  287. /paintoval
  288.     {
  289.     /cy sput
  290.     /dy sput
  291.     /y sput
  292.     /x sput
  293.     gsave
  294.     newpath
  295.     x y translate
  296.     dy cy scale
  297.     0 0 1 0 360 arc
  298.     fill
  299.     grestore
  300.     } bdf
  301. /pt
  302.     {
  303.     lineto    
  304.     } bdf
  305. /mt
  306.     {
  307.     moveto    
  308.     } bdf
  309. /ct
  310.     {
  311.     curveto    
  312.     } bdf
  313. /framepoly
  314.     {
  315.     /fillflag 0 def
  316.     newpath
  317.     } bdf
  318. /paintpoly
  319.     {
  320.     /fillflag 1 def
  321.     newpath
  322.     } bdf
  323. /closepoly
  324.     {
  325.     closepath
  326.     } bdf
  327. /polyend
  328.     {
  329.         fillflag 1 eq
  330.         {
  331.         eofill
  332.         }
  333.         {
  334.         pnh pnv eq
  335.             {
  336.             pnh setlinewidth stroke
  337.             }
  338.             {
  339.             gsave 1 setlinewidth pnh pnv scale stroke grestore
  340.             }ifelse
  341.         }ifelse
  342.     } bdf
  343. /pensize
  344.     {
  345.     /pnv sput
  346.     /pnh sput    
  347.     }bdf
  348. /dorotate
  349.     {
  350.     /ax sput
  351.     /y sput
  352.     /x sput    
  353.     gsave
  354.     x y translate
  355.     ax rotate
  356.     }bdf
  357. /endrotation
  358.     {
  359.     grestore
  360.     }bdf
  361. /doscale
  362.     {
  363.     /ax sput
  364.     /bx sput    
  365.     gsave
  366.     bx ax scale
  367.     }bdf
  368. /endscaling
  369.     {
  370.     grestore
  371.     }bdf
  372. /setlinestyle
  373.     {
  374.     setmiterlimit
  375.     setlinejoin
  376.     setlinecap
  377.     }bdf
  378. /graylevel
  379.     {
  380.     User_pattern 1 eq
  381.     {
  382.         /User_pattern 0 def
  383.         currentfrequence currentangle /currentproc load setscreen        
  384.     }if    
  385.     setgray
  386.     }bdf
  387. /icomp
  388.     {
  389.     /ncolors edf
  390.     ncolors 1 gt
  391.         {
  392.         /proc0 edf
  393.         dup dup 0 get ncolors div cvi exch 0 3 -1 roll put
  394.         4 -1 roll ncolors div cvi 4 1 roll
  395.             {
  396.             proc0 dup/st0 edf
  397.             0 exch ncolors exch length
  398.             dup ncolors sub exch ncolors div cvi string/st1 edf
  399.                 {
  400.                 dup 0 exch dup 1 exch
  401.                 2 add
  402.                     {
  403.                     st0 exch get add
  404.                     }bind for
  405.                 3 div ncolors 4 eq
  406.                     {
  407.                     exch dup 3 1 roll 3 add st0 exch get add 255 exch sub dup 0 lt
  408.                         {
  409.                         pop 0
  410.                         }if
  411.                     }if cvi
  412.                 dup 255 gt
  413.                     {
  414.                     pop 255
  415.                     }if
  416.                 exch ncolors div cvi exch
  417.                 st1 3 1 roll put
  418.                 }bind for
  419.             st1
  420.             }
  421.         }if i
  422.     }bdf
  423. %% width height xscale yscale xtran ytran im
  424. /im
  425.     {
  426.     translate
  427.     scale
  428.     /height edf
  429.     /width edf
  430.     /tbitstr width 7 add 8 div cvi string def
  431.     width height 1 [width 0 0 height neg 0 height]
  432.         {
  433.         currentfile tbitstr readhexstring pop
  434.         }bind
  435.     i
  436.     }bdf
  437. /imOR
  438.     {
  439.     translate
  440.     scale
  441.     /height edf
  442.     /width edf
  443.     /tbitstr width 7 add 8 div cvi string def
  444.     width height true [width 0 0 height neg 0 height]
  445.         {
  446.         currentfile tbitstr readhexstring pop
  447.         }bind
  448.     iOR
  449.     }bdf
  450. /ci
  451.     {
  452.     /colorimage where
  453.         {
  454.         pop false exch colorimage
  455.         }
  456.         {
  457.         icomp
  458.         }
  459.     ifelse
  460.     }bdf
  461. %%216 186 216 186 52 80 3 cm
  462. %% width height xscale yscale xtran ytran color cm
  463. /cm
  464.     {
  465.     /ncolors edf
  466.     translate
  467.     scale/height edf/colorimage where
  468.         {
  469.         pop
  470.         }
  471.         {
  472.         ncolors mul
  473.         }ifelse
  474.     /width edf
  475.     /tbitstr width string def
  476.     width height 8 [width 0 0 height neg 0 height]
  477.         {
  478.         currentfile tbitstr readhexstring pop
  479.         }bind
  480.     ncolors
  481.     dup 3 eq 
  482.         {
  483.         ci
  484.         }
  485.         {
  486.         icomp
  487.         }ifelse
  488.     }bdf
  489. /resetfontflags
  490.     {
  491.     /plain 0 def
  492.     /bold 0 def
  493.     /italic 0 def
  494.     /underline 0 def
  495.     /outline 0 def
  496.     /shadow 0 def
  497.     /condense 0 def
  498.     /extended 0 def
  499.     }bdf
  500. /boldthick
  501.     {
  502.     bold 1 eq 
  503.         {
  504.         fontsize 100 div    %% 40
  505.         }
  506.         {
  507.         fontsize 140 div    %% 55 
  508.         }ifelse
  509.     }bdf
  510. /textshow
  511.     {
  512.     /text sput
  513.     underline 1 eq
  514.         {
  515.         gsave
  516.         fontsize 14 div setlinewidth
  517.         currentpoint fontsize 8 div sub moveto  % Just to control the start
  518.         currentpoint exch text stringwidth pop add exch lineto stroke
  519.         grestore
  520.         }if
  521.     shadow 1 eq
  522.         {
  523.         gsave
  524.         boldthick setlinewidth
  525.         text true charpath gsave  0 setgray fill grestore stroke
  526.         grestore
  527.         gsave
  528.         currentpoint fontsize 18 div add exch fontsize 18 div sub exch moveto
  529.         boldthick bold 1 eq{1.3 mul}if setlinewidth
  530.         text true charpath gsave  1 setgray fill grestore stroke
  531.         grestore
  532.         text stringwidth rmoveto
  533.         }if
  534.     outline 1 eq
  535.         {
  536.         gsave
  537.         boldthick bold 1 eq {1.3 mul} if setlinewidth
  538.         text true charpath gsave 1 setgray fill grestore stroke
  539.         grestore
  540.         text stringwidth rmoveto
  541.         }if
  542.     bold 1 eq
  543.         {
  544.         outline 0 eq shadow 0 eq and
  545.             {
  546.             gsave
  547.             boldthick setlinewidth
  548.             text true charpath gsave  0 setgray fill grestore stroke
  549.             grestore
  550.             text stringwidth rmoveto
  551.             }if
  552.         }
  553.         {
  554.         outline 0 eq shadow 0 eq and
  555.             {
  556.             text show
  557.             }if
  558.         }ifelse
  559.     }bdf
  560.     
  561. /settextstyle
  562.     {
  563.     resetfontflags
  564.     counttomark /temp sput /temp temp 2 sub def
  565.     temp
  566.         {
  567.         dup (plain) eq
  568.             {
  569.             /plain 1 def pop
  570.             }if
  571.         dup (bold) eq
  572.             {
  573.             /bold 1 def pop
  574.             }if
  575.         dup (underline) eq
  576.             {
  577.             /underline 1 def pop
  578.             }if
  579.         dup (italic) eq
  580.             {
  581.             /italic 1 def pop
  582.             }if
  583.         dup (outline) eq
  584.             {
  585.             /outline 1 def pop
  586.             }if
  587.         dup (shadow) eq
  588.             {
  589.             /shadow 1 def pop
  590.             }if
  591.         dup (condence) eq
  592.             {
  593.             /condence 1 def pop
  594.             }if
  595.         dup (extended) eq
  596.             {
  597.             /extended 1 def pop
  598.             }if
  599.         }repeat
  600.     /fontsize sput
  601.     /fontname sput
  602.     fontname findfont fontsize scalefont ABdict /italic get 1 eq 
  603.         {
  604.         15 skewHMAT makefont
  605.         }if setfont
  606.     }bdf
  607.     
  608. /bitison
  609.     {
  610.     /bstring exch def /bwidth exch def
  611.     /ybit exch def /xbit exch def
  612.     bstring ybit bwidth mul
  613.     xbit 8 idiv add get
  614.     1 7 xbit 8 mod sub bitshift
  615.     and 0 ne
  616.     } bdf
  617. /setpattern
  618.     {
  619.     /freq 12 def
  620.     /bwidth 1 def
  621.     /bpside 8 def
  622.     /bstring exch def
  623.     /onbits 0 def /offbits 0 def /User_pattern 1 def%%
  624.     freq 0%Here, we begin to set up the arguments to `setscreen'.%
  625.         {
  626.         /y exch def /x exch def%This begins the screen function argument
  627.         %to `setscreen'.%
  628.         /xindex x 1 add 2 div%First, we transform the (x, y) position
  629.         bpside mul cvi def
  630.         /yindex y 1 add 2 div
  631.         bpside mul cvi def%%
  632.         xindex yindex bwidth bstring bitison
  633.             {
  634.             /onbits onbits 1 add def 1
  635.             }%If that bit is on, count it and
  636.             {
  637.             /offbits offbits 1 add def%If that bit is off, count it and
  638.             0
  639.             }
  640.         ifelse
  641.         }  setscreen
  642.         {
  643.         } settransfer
  644.     offbits offbits onbits add div
  645.     setgray
  646.     } def
  647. end
  648. %%EndProcSet
  649. %%BeginSetup
  650. ABdict begin
  651. 0 setlinecap
  652. 0 setlinejoin
  653. 4 setmiterlimit
  654. [] 0 setdash
  655. /currentx.rot 0 def
  656. /currenty.rot 0 def
  657. currentscreen /currentproc edf/currentangle edf/currentfrequence edf
  658. /pat <d1e3c5885c3e1d88> def
  659. /User_pattern 1 def
  660. 0 graylevel
  661. resetfontflags
  662. end
  663. %%EndSetup
  664.